<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>IT课程数据分析与可视化系统</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
        }
        
        .hero {
            text-align: center;
            padding: 2rem;
        }
        
        .hero h1 {
            font-size: 3rem;
            margin-bottom: 1rem;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
        }
        
        .hero p {
            font-size: 1.25rem;
            margin-bottom: 2rem;
            opacity: 0.9;
        }
        
        .features {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 2rem;
            margin: 3rem 0;
            max-width: 1000px;
        }
        
        .feature {
            background: rgba(255,255,255,0.1);
            backdrop-filter: blur(10px);
            padding: 2rem;
            border-radius: 12px;
            border: 1px solid rgba(255,255,255,0.2);
        }
        
        .feature h3 {
            font-size: 1.5rem;
            margin-bottom: 1rem;
        }
        
        .feature p {
            opacity: 0.9;
            line-height: 1.6;
        }
        
        .cta-buttons {
            display: flex;
            gap: 1.5rem;
            justify-content: center;
            margin-top: 2rem;
        }
        
        .btn {
            padding: 1rem 2rem;
            font-size: 1.1rem;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
            text-decoration: none;
            display: inline-block;
        }
        
        .btn-primary {
            background: white;
            color: #667eea;
            font-weight: 600;
        }
        
        .btn-primary:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 20px rgba(0,0,0,0.2);
        }
        
        .btn-secondary {
            background: rgba(255,255,255,0.2);
            color: white;
            border: 2px solid white;
        }
        
        .btn-secondary:hover {
            background: rgba(255,255,255,0.3);
        }
        
        .stats {
            display: flex;
            gap: 3rem;
            justify-content: center;
            margin-top: 3rem;
        }
        
        .stat {
            text-align: center;
        }
        
        .stat-number {
            font-size: 2.5rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
        }
        
        .stat-label {
            opacity: 0.9;
            font-size: 1rem;
        }
    </style>
</head>
<body>
    <div class="hero">
        <h1 id="site-title">📊 IT课程数据分析系统</h1>
        <p id="site-description">基于Flask的数据驱动教学决策支持平台</p>
        
        <div class="features">
            <div class="feature">
                <h3>🔐 智能认证</h3>
                <p>JWT + RBAC权限控制，支持管理员、教师、学生三种角色</p>
            </div>
            <div class="feature">
                <h3>📈 数据分析</h3>
                <p>成绩分布、GPA趋势、课程统计等多维度分析</p>
            </div>
            <div class="feature">
                <h3>📊 可视化</h3>
                <p>ECharts交互式图表，直观展示教学数据</p>
            </div>
            <div class="feature">
                <h3>🎯 智能推荐</h3>
                <p>基于协同过滤的个性化课程推荐系统</p>
            </div>
        </div>
        
        <div class="cta-buttons">
            <a href="/login" class="btn btn-primary">立即登录</a>
        </div>
        
        <div class="stats">
            <div class="stat">
                <div class="stat-number">1000+</div>
                <div class="stat-label">学生用户</div>
            </div>
            <div class="stat">
                <div class="stat-number">50+</div>
                <div class="stat-label">课程数据</div>
            </div>
            <div class="stat">
                <div class="stat-number">20000+</div>
                <div class="stat-label">成绩记录</div>
            </div>
        </div>
    </div>
    
    <script>
        // 加载系统配置
        async function loadConfig() {
            try {
                const response = await fetch('/api/v1/settings/public');
                const data = await response.json();
                
                if (data.success) {
                    const config = data.data;
                    if (config.site_name) {
                        document.getElementById('site-title').textContent = '📊 ' + config.site_name;
                        document.title = config.site_name;
                    }
                    if (config.site_description) {
                        document.getElementById('site-description').textContent = config.site_description;
                    }
                }
            } catch (error) {
                console.log('加载配置失败:', error);
            }
        }
        
        // 页面加载时执行
        loadConfig();
        
        // 如果已登录，自动跳转到仪表盘
        const token = localStorage.getItem('access_token');
        if (token) {
            const userInfo = JSON.parse(localStorage.getItem('user_info') || '{}');
            if (userInfo.role) {
                window.location.href = `/${userInfo.role}/dashboard`;
            }
        }
    </script>
</body>
</html>




